Skip to content

Glows L2 - Apply calibration#2918

Open
vmartinez-cu wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:glows-l2-calibration
Open

Glows L2 - Apply calibration#2918
vmartinez-cu wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:glows-l2-calibration

Conversation

@vmartinez-cu
Copy link
Copy Markdown
Collaborator

@vmartinez-cu vmartinez-cu commented Apr 3, 2026

This pull request implements the use of a time-dependent calibration factor for GLOWS L2 data processing, ensuring that photon flux and uncertainties are correctly converted to physical units (Rayleighs) using ancillary calibration data. The changes include updating data structures, processing logic, and tests to support calibration lookup and application.

Key changes:

GLOWS L2 Data Processing and Calibration

  • The HistogramL2 and DailyLightcurve classes were updated to accept and use a calibration factor (counts per second per Rayleigh), which is required for correct photon flux and uncertainty calculations. The calibration factor is selected based on the mid-epoch of the observational day using a new static method, get_calibration_factor.

  • The main glows_l2 processing function passes a calibration dataset through to the HistogramL2 data class.

Ancillary Calibration Data Handling

  • The ancillary calibration file reader (convert_file_to_dataset) was refactored to store calibration times as coordinates and ensure the dataset is sorted by time, improving reliability when selecting calibration factors.

Testing Enhancements

  • Test fixtures and test cases were updated to mock calibration datasets and verify that calibration factors are correctly selected and applied in flux and uncertainty calculations.

Closes #2886

…r calibration factors and sort data by time. Update corresponding unit test to reflect changes
…t for the calibration factor needed for flux calculations. Update existing tests where needed to fix broken tests
@vmartinez-cu vmartinez-cu added enhancement New feature or request Ins: GLOWS Related to the GLOWS instrument Level: L2 Level 2 processing labels Apr 3, 2026
@vmartinez-cu vmartinez-cu added this to IMAP Apr 3, 2026
@vmartinez-cu vmartinez-cu added this to the April 2026 milestone Apr 3, 2026
@vmartinez-cu vmartinez-cu moved this to PR Open in IMAP Apr 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for applying a time-dependent GLOWS L2 calibration factor (counts/s per Rayleigh) when converting daily lightcurve histogram rates and uncertainties into physical units (Rayleighs), using an ancillary “l2-calibration” dataset.

Changes:

  • Plumbs a calibration dataset through glows_l2()HistogramL2DailyLightcurve and applies it in flux/uncertainty calculations.
  • Adds HistogramL2.get_calibration_factor() to select an appropriate factor based on the mid-epoch of the observation day.
  • Refactors the GLOWS ancillary calibration .dat reader to store calibration times as coordinates and sort by time; updates/extends tests and fixtures accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
imap_processing/glows/l2/glows_l2.py Passes calibration dataset into HistogramL2 during L2 generation.
imap_processing/glows/l2/glows_l2_data.py Adds calibration-factor selection and applies calibration in DailyLightcurve flux math.
imap_processing/ancillary/ancillary_dataset_combiner.py Refactors l2-calibration .dat ingestion to use start_time_utc as a coordinate and sorts by it.
imap_processing/tests/glows/conftest.py Adds a mock calibration dataset fixture.
imap_processing/tests/glows/test_glows_l2.py Updates tests to provide calibration dataset to glows_l2()/HistogramL2.
imap_processing/tests/glows/test_glows_l2_data.py Adds coverage for calibration-factor selection; updates flux/uncertainty expectations with calibration.
imap_processing/tests/ancillary/test_ancillary_dataset_combiner.py Extends calibration combiner test and asserts coordinate usage/sorting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Ins: GLOWS Related to the GLOWS instrument Level: L2 Level 2 processing

Projects

Status: PR Open

Development

Successfully merging this pull request may close these issues.

GLOWS L2: Apply cps-to-Rayleigh calibration factor using ancillary calibration file

2 participants